from ..ApiBase.ApiBase import ApiBase
from Read.read_yaml import read_config
import pytest

@pytest.fixture(scope="session")
def api_client():
    config_path=r"D:\桌面\Project\PythonProject2\ApiBase\config.yaml"
    """全局会话级别的API客户端夹具，所有用例共享一个会话"""
    config=read_config(config_path,env='test')
    # 初始化API客户端（创建会话）
    api = ApiBase()
    yield api  # 提供API客户端实例给测试用例
    api.session.close()